package kr.co.bnsmedia.touchconfig;

public final class g {

	public static final class usbhid {
		public static final int PKT_MAX_LEN = 64;
		public static final int PKT_HEAD_LEN = 4;
		public static final int PKT_DATA_MAX_LEN = (PKT_MAX_LEN - PKT_HEAD_LEN);
		public static final int PKT_REPORT_ID = 0x21;	// <usbd_conf.h> HID_REPORT_ID

		public static final int PKT_POS_RID = 0;
		public static final int PKT_POS_CMD = 1;
		public static final int PKT_POS_DEV = 2;
		public static final int PKT_POS_DLEN = 3;
		public static final int PKT_POS_DATA = 4;
	}

	public static final class state {
		public static final int UNKNOWN = 0;
		//...
		public static final int IAP_INIT = 11;
		public static final int IAP_UPGRADE = 12;
		//...
		public static final int INIT = 21;
		public static final int TOUCH = 22;
		public static final int SIDEVIEW = 23;
		public static final int DETECTION = 24;
		public static final int CALIBRATION = 25;
		//...
	}

	public static final class device {
		public static final int TOUCH = 0;
		public static final int CAMERA1 = 1;
		public static final int CAMERA2 = 2;
		public static final int CAMERA3 = 3;
		public static final int CAMERA4 = 4;
		//...
		public static final int MAX_COUNT = 5;
		public static final int MAX_CAMERA = 2;
	}

	public static final int RESET_IAP = 0x00;
	public static final int RESET_APP = 0x01;

	//public static final int FWTYPE_IAP = 0x00; 
	//public static final int FWTYPE_APP = 0x01; 
	public static final int FWTYPE_SAVE_APP = 0x02;
	public static final int FWTYPE_SAVE_IAP = 0x03;

	public static final int OSTYPE_UNKNOWN = 0x00; 
	public static final int OSTYPE_WINDOWS = 0x01; 
	public static final int OSTYPE_LINUX = 0x02;
	public static final int OSTYPE_ANDROID = 0x03;

	public static final int DATA_FILTER_NUM_MIN = 1;
	public static final int DATA_FILTER_NUM_DEF = 10;
	public static final int DATA_FILTER_NUM_MAX = 20;

	public static final int DATA_INPUT_MODE_MOUSE = 0;
	public static final int DATA_INPUT_MODE_SINGLE = 1;
	public static final int DATA_INPUT_MODE_MULTI = 2;

	public static final int DATA_PWM_NUM = 4;
	public static final int DATA_PWM_MIN = 0;
	public static final int DATA_PWM_DEF = 100;
	public static final int DATA_PWM_MAX = 100;

	public static final int DATA_YCENTER_MIN = -300;
	public static final int DATA_YCENTER_DEF = 0;
	public static final int DATA_YCENTER_MAX = 300;

	public static final int DATA_THRESHOLD_MIN = 0;
	public static final int DATA_THRESHOLD_DEF = 180;
	public static final int DATA_THRESHOLD_MAX = 255;

	public static final int DATA_XSTART_MIN = 0;	//25
	public static final int DATA_XSTART_DEF = 400;
	public static final int DATA_XSTART_MAX = 400;

	public static final int DATA_XEND_MIN = 1200;
	public static final int DATA_XEND_DEF = 1200;
	public static final int DATA_XEND_MAX = 1599;	//1000

	public static final int DATA_MINWIDTH_MIN = 1;
	public static final int DATA_MINWIDTH_DEF = 3;
	public static final int DATA_MINWIDTH_MAX = 5;

	public static final int DATA_AVERAGELIGHT_MIN = 0;
	public static final int DATA_AVERAGELIGHT_DEF = 80;
	public static final int DATA_AVERAGELIGHT_MAX = 255;

	public static final int DATA_COEFFS_NUM = 8;
	public static final int DATA_COEFFS_MARGIN_SX = 1;	//[%]
	public static final int DATA_COEFFS_MARGIN_EX = 99;	//[%]
	public static final int DATA_COEFFS_MARGIN_SY = 2;	//[%]
	public static final int DATA_COEFFS_MARGIN_EY = 95;	//[%]


	public static final int SIDEVIEW_IMAGE_WIDTH = 100;
	public static final int SIDEVIEW_IMAGE_HEIGHT = 25;
	public static final int SIDEVIEW_IMAGE_SIZE = SIDEVIEW_IMAGE_WIDTH * SIDEVIEW_IMAGE_HEIGHT;

	public static final int DETECTION_IMAGE_WIDTH = 1600;
	public static final int DETECTION_IMAGE_HEIGHT = 1;
	public static final int DETECTION_IMAGE_SIZE = DETECTION_IMAGE_WIDTH * DETECTION_IMAGE_HEIGHT;

	public static final int CALIBRATION_RADIAN_MAX_NUM = device.MAX_CAMERA;


	public static final class command {
		public static final int PING = 0x01;
		public static final int RESET = 0x02;
		public static final int GET_VERSION = 0x03;
		public static final int UPGRADE_FWINFO = 0x04;
		public static final int UPGRADE_FWDATA = 0x05;
		public static final int GET_STATE = 0x06;
		public static final int SET_STATE = 0x07;
		public static final int SET_BUZZER = 0x08;
		public static final int FORMAT_STORAGE = 0x09;
		//...
		public static final int TEST_CODE = 0x21; 
		//...
		public static final int GET_TOUCH_CONFIG = 0x31;
		public static final int SET_TOUCH_CONFIG = 0x32;
		public static final int SET_TOUCH_FILTER = 0x33;
		public static final int SET_INPUT_MODE = 0x34;
		public static final int SET_PWMS = 0x35;
		public static final int SET_TAP_TIME = 0x36;
		public static final int SET_LTAP_TIME = 0x37;
		public static final int SET_TAP_AREA = 0x38;
		public static final int SET_DTAP_AREA = 0x39;
		public static final int SET_PALM_AREA = 0x3A;
		public static final int SET_BEEP_ALERT = 0x3B;
		public static final int SET_BEEP_CLICK = 0x3C;
		public static final int SET_TOUCH_NOSEND = 0x3D;
		//...
		public static final int GET_CAMERA_CONFIG = 0x91;
		public static final int SET_CAMERA_CONFIG = 0x92;
		public static final int SET_YCENTER = 0x93;
		public static final int SET_XSTART = 0x94;
		public static final int SET_XEND = 0x95;
		public static final int SET_THRESHOLD = 0x96;
		public static final int SET_MINWIDTH = 0x97;
		public static final int SET_AVERAGELIGHT = 0x98;
		public static final int SET_COEFFS = 0x99;
		//...
		public static final int SIDEVIEW_START = 0xB1;
		public static final int DETECTION_START = 0xB2;
		public static final int CALIBRATION_START = 0xB3;
		//...
		public static final int RESULT_SUCCESS = 0xC1;
		public static final int RESULT_ERROR = 0xC2;
		//...
		public static final int EVT_CAMERA_INIT = 0xE1;
		public static final int EVT_IMAGE_SIDEVIEW = 0xE2;
		public static final int EVT_IMAGE_DETECTION = 0xE3;
		public static final int EVT_RADIAN_DATA = 0xE4;
		public static final int EVT_LINEEQ_DATA = 0xE5;
		//...
	}
}
